home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / unsrt.bst < prev    next >
Text File  |  1988-01-22  |  17KB  |  952 lines

  1. % BibTeX standard bibliography style `unsrt'
  2.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.     % Copyright (C) 1985, all rights reserved.
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  8.     % This restriction helps ensure that all standard styles are identical.
  9.     % The file btxbst.doc has the documentation for this style.
  10.  
  11. ENTRY
  12.   { address
  13.     author
  14.     booktitle
  15.     chapter
  16.     edition
  17.     editor
  18.     howpublished
  19.     institution
  20.     journal
  21.     key
  22.     month
  23.     note
  24.     number
  25.     organization
  26.     pages
  27.     publisher
  28.     school
  29.     series
  30.     title
  31.     type
  32.     volume
  33.     year
  34.   }
  35.   {}
  36.   { label }
  37.  
  38. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  39.  
  40. FUNCTION {init.state.consts}
  41. { #0 'before.all :=
  42.   #1 'mid.sentence :=
  43.   #2 'after.sentence :=
  44.   #3 'after.block :=
  45. }
  46.  
  47. STRINGS { s t }
  48.  
  49. FUNCTION {output.nonnull}
  50. { 's :=
  51.   output.state mid.sentence =
  52.     { ", " * write$ }
  53.     { output.state after.block =
  54.     { add.period$ write$
  55.       newline$
  56.       "\newblock " write$
  57.     }
  58.     { output.state before.all =
  59.         'write$
  60.         { add.period$ " " * write$ }
  61.       if$
  62.     }
  63.       if$
  64.       mid.sentence 'output.state :=
  65.     }
  66.   if$
  67.   s
  68. }
  69.  
  70. FUNCTION {output}
  71. { duplicate$ empty$
  72.     'pop$
  73.     'output.nonnull
  74.   if$
  75. }
  76.  
  77. FUNCTION {output.check}
  78. { 't :=
  79.   duplicate$ empty$
  80.     { pop$ "empty " t * " in " * cite$ * warning$ }
  81.     'output.nonnull
  82.   if$
  83. }
  84.  
  85. FUNCTION {output.bibitem}
  86. { newline$
  87.   "\bibitem{" write$
  88.   cite$ write$
  89.   "}" write$
  90.   newline$
  91.   ""
  92.   before.all 'output.state :=
  93. }
  94.  
  95. FUNCTION {fin.entry}
  96. { add.period$
  97.   write$
  98.   newline$
  99. }
  100.  
  101. FUNCTION {new.block}
  102. { output.state before.all =
  103.     'skip$
  104.     { after.block 'output.state := }
  105.   if$
  106. }
  107.  
  108. FUNCTION {new.sentence}
  109. { output.state after.block =
  110.     'skip$
  111.     { output.state before.all =
  112.     'skip$
  113.     { after.sentence 'output.state := }
  114.       if$
  115.     }
  116.   if$
  117. }
  118.  
  119. FUNCTION {not}
  120. {   { #0 }
  121.     { #1 }
  122.   if$
  123. }
  124.  
  125. FUNCTION {and}
  126. {   'skip$
  127.     { pop$ #0 }
  128.   if$
  129. }
  130.  
  131. FUNCTION {or}
  132. {   { pop$ #1 }
  133.     'skip$
  134.   if$
  135. }
  136.  
  137. FUNCTION {new.block.checka}
  138. { empty$
  139.     'skip$
  140.     'new.block
  141.   if$
  142. }
  143.  
  144. FUNCTION {new.block.checkb}
  145. { empty$
  146.   swap$ empty$
  147.   and
  148.     'skip$
  149.     'new.block
  150.   if$
  151. }
  152.  
  153. FUNCTION {new.sentence.checka}
  154. { empty$
  155.     'skip$
  156.     'new.sentence
  157.   if$
  158. }
  159.  
  160. FUNCTION {new.sentence.checkb}
  161. { empty$
  162.   swap$ empty$
  163.   and
  164.     'skip$
  165.     'new.sentence
  166.   if$
  167. }
  168.  
  169. FUNCTION {field.or.null}
  170. { duplicate$ empty$
  171.     { pop$ "" }
  172.     'skip$
  173.   if$
  174. }
  175.  
  176. FUNCTION {emphasize}
  177. { duplicate$ empty$
  178.     { pop$ "" }
  179.     { "{\em " swap$ * "}" * }
  180.   if$
  181. }
  182.  
  183. INTEGERS { nameptr namesleft numnames }
  184.  
  185. FUNCTION {format.names}
  186. { 's :=
  187.   #1 'nameptr :=
  188.   s num.names$ 'numnames :=
  189.   numnames 'namesleft :=
  190.     { namesleft #0 > }
  191.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  192.       nameptr #1 >
  193.     { namesleft #1 >
  194.         { ", " * t * }
  195.         { numnames #2 >
  196.         { "," * }
  197.         'skip$
  198.           if$
  199.           t "others" =
  200.         { " et~al." * }
  201.         { " and " * t * }
  202.           if$
  203.         }
  204.       if$
  205.     }
  206.     't
  207.       if$
  208.       nameptr #1 + 'nameptr :=
  209.       namesleft #1 - 'namesleft :=
  210.     }
  211.   while$
  212. }
  213.  
  214. FUNCTION {format.authors}
  215. { author empty$
  216.     { "" }
  217.     { author format.names }
  218.   if$
  219. }
  220.  
  221. FUNCTION {format.editors}
  222. { editor empty$
  223.     { "" }
  224.     { editor format.names
  225.       editor num.names$ #1 >
  226.     { ", editors" * }
  227.     { ", editor" * }
  228.       if$
  229.     }
  230.   if$
  231. }
  232.  
  233. FUNCTION {format.title}
  234. { title empty$
  235.     { "" }
  236.     { title "t" change.case$ }
  237.   if$
  238. }
  239.  
  240. FUNCTION {n.dashify}
  241. { 't :=
  242.   ""
  243.     { t empty$ not }
  244.     { t #1 #1 substring$ "-" =
  245.     { t #1 #2 substring$ "--" = not
  246.         { "--" *
  247.           t #2 global.max$ substring$ 't :=
  248.         }
  249.         {   { t #1 #1 substring$ "-" = }
  250.         { "-" *
  251.           t #2 global.max$ substring$ 't :=
  252.         }
  253.           while$
  254.         }
  255.       if$
  256.     }
  257.     { t #1 #1 substring$ *
  258.       t #2 global.max$ substring$ 't :=
  259.     }
  260.       if$
  261.     }
  262.   while$
  263. }
  264.  
  265. FUNCTION {format.date}
  266. { year empty$
  267.     { month empty$
  268.     { "" }
  269.     { "there's a month but no year in " cite$ * warning$
  270.       month
  271.     }
  272.       if$
  273.     }
  274.     { month empty$
  275.     'year
  276.     { month " " * year * }
  277.       if$
  278.     }
  279.   if$
  280. }
  281.  
  282. FUNCTION {format.btitle}
  283. { title emphasize
  284. }
  285.  
  286. FUNCTION {tie.or.space.connect}
  287. { duplicate$ text.length$ #3 <
  288.     { "~" }
  289.     { " " }
  290.   if$
  291.   swap$ * *
  292. }
  293.  
  294. FUNCTION {either.or.check}
  295. { empty$
  296.     'pop$
  297.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  298.   if$
  299. }
  300.  
  301. FUNCTION {format.bvolume}
  302. { volume empty$
  303.     { "" }
  304.     { "volume" volume tie.or.space.connect
  305.       series empty$
  306.     'skip$
  307.     { " of " * series emphasize * }
  308.       if$
  309.       "volume and number" number either.or.check
  310.     }
  311.   if$
  312. }
  313.  
  314. FUNCTION {format.number.series}
  315. { volume empty$
  316.     { number empty$
  317.     { series field.or.null }
  318.     { output.state mid.sentence =
  319.         { "number" }
  320.         { "Number" }
  321.       if$
  322.       number tie.or.space.connect
  323.       series empty$
  324.         { "there's a number but no series in " cite$ * warning$ }
  325.         { " in " * series * }
  326.       if$
  327.     }
  328.       if$
  329.     }
  330.     { "" }
  331.   if$
  332. }
  333.  
  334. FUNCTION {format.edition}
  335. { edition empty$
  336.     { "" }
  337.     { output.state mid.sentence =
  338.     { edition "l" change.case$ " edition" * }
  339.     { edition "t" change.case$ " edition" * }
  340.       if$
  341.     }
  342.   if$
  343. }
  344.  
  345. INTEGERS { multiresult }
  346.  
  347. FUNCTION {multi.page.check}
  348. { 't :=
  349.   #0 'multiresult :=
  350.     { multiresult not
  351.       t empty$ not
  352.       and
  353.     }
  354.     { t #1 #1 substring$
  355.       duplicate$ "-" =
  356.       swap$ duplicate$ "," =
  357.       swap$ "+" =
  358.       or or
  359.     { #1 'multiresult := }
  360.     { t #2 global.max$ substring$ 't := }
  361.       if$
  362.     }
  363.   while$
  364.   multiresult
  365. }
  366.  
  367. FUNCTION {format.pages}
  368. { pages empty$
  369.     { "" }
  370.     { pages multi.page.check
  371.     { "pages" pages n.dashify tie.or.space.connect }
  372.     { "page" pages tie.or.space.connect }
  373.       if$
  374.     }
  375.   if$
  376. }
  377.  
  378. FUNCTION {format.vol.num.pages}
  379. { volume field.or.null
  380.   number empty$
  381.     'skip$
  382.     { "(" number * ")" * *
  383.       volume empty$
  384.     { "there's a number but no volume in " cite$ * warning$ }
  385.     'skip$
  386.       if$
  387.     }
  388.   if$
  389.   pages empty$
  390.     'skip$
  391.     { duplicate$ empty$
  392.     { pop$ format.pages }
  393.     { ":" * pages n.dashify * }
  394.       if$
  395.     }
  396.   if$
  397. }
  398.  
  399. FUNCTION {format.chapter.pages}
  400. { chapter empty$
  401.     'format.pages
  402.     { type empty$
  403.     { "chapter" }
  404.     { type "l" change.case$ }
  405.       if$
  406.       chapter tie.or.space.connect
  407.       pages empty$
  408.     'skip$
  409.     { ", " * format.pages * }
  410.       if$
  411.     }
  412.   if$
  413. }
  414.  
  415. FUNCTION {format.in.ed.booktitle}
  416. { booktitle empty$
  417.     { "" }
  418.     { editor empty$
  419.     { "In " booktitle emphasize * }
  420.     { "In " format.editors * ", " * booktitle emphasize * }
  421.       if$
  422.     }
  423.   if$
  424. }
  425.  
  426. FUNCTION {empty.misc.check}
  427. { author empty$ title empty$ howpublished empty$
  428.   month empty$ year empty$ note empty$
  429.   and and and and and
  430.     { "all relevant fields are empty in " cite$ * warning$ }
  431.     'skip$
  432.   if$
  433. }
  434.  
  435. FUNCTION {format.thesis.type}
  436. { type empty$
  437.     'skip$
  438.     { pop$
  439.       type "t" change.case$
  440.     }
  441.   if$
  442. }
  443.  
  444. FUNCTION {format.tr.number}
  445. { type empty$
  446.     { "Technical Report" }
  447.     'type
  448.   if$
  449.   number empty$
  450.     { "t" change.case$ }
  451.     { number tie.or.space.connect }
  452.   if$
  453. }
  454.  
  455. FUNCTION {format.article.crossref}
  456. { key empty$
  457.     { journal empty$
  458.     { "need key or journal for " cite$ * " to crossref " * crossref *
  459.       warning$
  460.       ""
  461.     }
  462.     { "In {\em " journal * "\/}" * }
  463.       if$
  464.     }
  465.     { "In " key * }
  466.   if$
  467.   " \cite{" * crossref * "}" *
  468. }
  469.  
  470. FUNCTION {format.crossref.editor}
  471. { editor #1 "{vv~}{ll}" format.name$
  472.   editor num.names$ duplicate$
  473.   #2 >
  474.     { pop$ " et~al." * }
  475.     { #2 <
  476.     'skip$
  477.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  478.         { " et~al." * }
  479.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  480.       if$
  481.     }
  482.       if$
  483.     }
  484.   if$
  485. }
  486.  
  487. FUNCTION {format.book.crossref}
  488. { volume empty$
  489.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  490.       "In "
  491.     }
  492.     { "Volume" volume tie.or.space.connect
  493.       " of " *
  494.     }
  495.   if$
  496.   editor empty$
  497.   editor field.or.null author field.or.null =
  498.   or
  499.     { key empty$
  500.     { series empty$
  501.         { "need editor, key, or series for " cite$ * " to crossref " *
  502.           crossref * warning$
  503.           "" *
  504.         }
  505.         { "{\em " * series * "\/}" * }
  506.       if$
  507.     }
  508.     { key * }
  509.       if$
  510.     }
  511.     { format.crossref.editor * }
  512.   if$
  513.   " \cite{" * crossref * "}" *
  514. }
  515.  
  516. FUNCTION {format.incoll.inproc.crossref}
  517. { editor empty$
  518.   editor field.or.null author field.or.null =
  519.   or
  520.     { key empty$
  521.     { booktitle empty$
  522.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  523.           crossref * warning$
  524.           ""
  525.         }
  526.         { "In {\em " booktitle * "\/}" * }
  527.       if$
  528.     }
  529.     { "In " key * }
  530.       if$
  531.     }
  532.     { "In " format.crossref.editor * }
  533.   if$
  534.   " \cite{" * crossref * "}" *
  535. }
  536.  
  537. FUNCTION {article}
  538. { output.bibitem
  539.   format.authors "author" output.check
  540.   new.block
  541.   format.title "title" output.check
  542.   new.block
  543.   crossref missing$
  544.     { journal emphasize "journal" output.check
  545.       format.vol.num.pages output
  546.       format.date "year" output.check
  547.     }
  548.     { format.article.crossref output.nonnull
  549.       format.pages output
  550.     }
  551.   if$
  552.   new.block
  553.   note output
  554.   fin.entry
  555. }
  556.  
  557. FUNCTION {book}
  558. { output.bibitem
  559.   author empty$
  560.     { format.editors "author and editor" output.check }
  561.     { format.authors output.nonnull
  562.       crossref missing$
  563.     { "author and editor" editor either.or.check }
  564.     'skip$
  565.       if$
  566.     }
  567.   if$
  568.   new.block
  569.   format.btitle "title" output.check
  570.   crossref missing$
  571.     { format.bvolume output
  572.       new.block
  573.       format.number.series output
  574.       new.sentence
  575.       publisher "publisher" output.check
  576.       address output
  577.     }
  578.     { new.block
  579.       format.book.crossref output.nonnull
  580.     }
  581.   if$
  582.   format.edition output
  583.   format.date "year" output.check
  584.   new.block
  585.   note output
  586.   fin.entry
  587. }
  588.  
  589. FUNCTION {booklet}
  590. { output.bibitem
  591.   format.authors output
  592.   new.block
  593.   format.title "title" output.check
  594.   howpublished address new.block.checkb
  595.   howpublished output
  596.   address output
  597.   format.date output
  598.   new.block
  599.   note output
  600.   fin.entry
  601. }
  602.  
  603. FUNCTION {inbook}
  604. { output.bibitem
  605.   author empty$
  606.     { format.editors "author and editor" output.check }
  607.     { format.authors output.nonnull
  608.       crossref missing$
  609.     { "author and editor" editor either.or.check }
  610.     'skip$
  611.       if$
  612.     }
  613.   if$
  614.   new.block
  615.   format.btitle "title" output.check
  616.   crossref missing$
  617.     { format.bvolume output
  618.       format.chapter.pages "chapter and pages" output.check
  619.       new.block
  620.       format.number.series output
  621.       new.sentence
  622.       publisher "publisher" output.check
  623.       address output
  624.     }
  625.     { format.chapter.pages "chapter and pages" output.check
  626.       new.block
  627.       format.book.crossref output.nonnull
  628.     }
  629.   if$
  630.   format.edition output
  631.   format.date "year" output.check
  632.   new.block
  633.   note output
  634.   fin.entry
  635. }
  636.  
  637. FUNCTION {incollection}
  638. { output.bibitem
  639.   format.authors "author" output.check
  640.   new.block
  641.   format.title "title" output.check
  642.   new.block
  643.   crossref missing$
  644.     { format.in.ed.booktitle "booktitle" output.check
  645.       format.bvolume output
  646.       format.number.series output
  647.       format.chapter.pages output
  648.       new.sentence
  649.       publisher "publisher" output.check
  650.       address output
  651.       format.edition output
  652.       format.date "year" output.check
  653.     }
  654.     { format.incoll.inproc.crossref output.nonnull
  655.       format.chapter.pages output
  656.     }
  657.   if$
  658.   new.block
  659.   note output
  660.   fin.entry
  661. }
  662.  
  663. FUNCTION {inproceedings}
  664. { output.bibitem
  665.   format.authors "author" output.check
  666.   new.block
  667.   format.title "title" output.check
  668.   new.block
  669.   crossref missing$
  670.     { format.in.ed.booktitle "booktitle" output.check
  671.       format.bvolume output
  672.       format.number.series output
  673.       format.pages output
  674.       address empty$
  675.     { organization publisher new.sentence.checkb
  676.       organization output
  677.       publisher output
  678.       format.date "year" output.check
  679.     }
  680.     { address output.nonnull
  681.       format.date "year" output.check
  682.       new.sentence
  683.       organization output
  684.       publisher output
  685.     }
  686.       if$
  687.     }
  688.     { format.incoll.inproc.crossref output.nonnull
  689.       format.pages output
  690.     }
  691.   if$
  692.   new.block
  693.   note output
  694.   fin.entry
  695. }
  696.  
  697. FUNCTION {conference} { inproceedings }
  698.  
  699. FUNCTION {manual}
  700. { output.bibitem
  701.   author empty$
  702.     { organization empty$
  703.     'skip$
  704.     { organization output.nonnull
  705.       address output
  706.     }
  707.       if$
  708.     }
  709.     { format.authors output.nonnull }
  710.   if$
  711.   new.block
  712.   format.btitle "title" output.check
  713.   author empty$
  714.     { organization empty$
  715.     { address new.block.checka
  716.       address output
  717.     }
  718.     'skip$
  719.       if$
  720.     }
  721.     { organization address new.block.checkb
  722.       organization output
  723.       address output
  724.     }
  725.   if$
  726.   format.edition output
  727.   format.date output
  728.   new.block
  729.   note output
  730.   fin.entry
  731. }
  732.  
  733. FUNCTION {mastersthesis}
  734. { output.bibitem
  735.   format.authors "author" output.check
  736.   new.block
  737.   format.title "title" output.check
  738.   new.block
  739.   "Master's thesis" format.thesis.type output.nonnull
  740.   school "school" output.check
  741.   address output
  742.   format.date "year" output.check
  743.   new.block
  744.   note output
  745.   fin.entry
  746. }
  747.  
  748. FUNCTION {misc}
  749. { output.bibitem
  750.   format.authors output
  751.   title howpublished new.block.checkb
  752.   format.title output
  753.   howpublished new.block.checka
  754.   howpublished output
  755.   format.date output
  756.   new.block
  757.   note output
  758.   fin.entry
  759.   empty.misc.check
  760. }
  761.  
  762. FUNCTION {phdthesis}
  763. { output.bibitem
  764.   format.authors "author" output.check
  765.   new.block
  766.   format.btitle "title" output.check
  767.   new.block
  768.   "PhD thesis" format.thesis.type output.nonnull
  769.   school "school" output.check
  770.   address output
  771.   format.date "year" output.check
  772.   new.block
  773.   note output
  774.   fin.entry
  775. }
  776.  
  777. FUNCTION {proceedings}
  778. { output.bibitem
  779.   editor empty$
  780.     { organization output }
  781.     { format.editors output.nonnull }
  782.   if$
  783.   new.block
  784.   format.btitle "title" output.check
  785.   format.bvolume output
  786.   format.number.series output
  787.   address empty$
  788.     { editor empty$
  789.     { publisher new.sentence.checka }
  790.     { organization publisher new.sentence.checkb
  791.       organization output
  792.     }
  793.       if$
  794.       publisher output
  795.       format.date "year" output.check
  796.     }
  797.     { address output.nonnull
  798.       format.date "year" output.check
  799.       new.sentence
  800.       editor empty$
  801.     'skip$
  802.     { organization output }
  803.       if$
  804.       publisher output
  805.     }
  806.   if$
  807.   new.block
  808.   note output
  809.   fin.entry
  810. }
  811.  
  812. FUNCTION {techreport}
  813. { output.bibitem
  814.   format.authors "author" output.check
  815.   new.block
  816.   format.title "title" output.check
  817.   new.block
  818.   format.tr.number output.nonnull
  819.   institution "institution" output.check
  820.   address output
  821.   format.date "year" output.check
  822.   new.block
  823.   note output
  824.   fin.entry
  825. }
  826.  
  827. FUNCTION {unpublished}
  828. { output.bibitem
  829.   format.authors "author" output.check
  830.   new.block
  831.   format.title "title" output.check
  832.   new.block
  833.   note "note" output.check
  834.   format.date output
  835.   fin.entry
  836. }
  837.  
  838. FUNCTION {default.type} { misc }
  839.  
  840. MACRO {jan} {"January"}
  841.  
  842. MACRO {feb} {"February"}
  843.  
  844. MACRO {mar} {"March"}
  845.  
  846. MACRO {apr} {"April"}
  847.  
  848. MACRO {may} {"May"}
  849.  
  850. MACRO {jun} {"June"}
  851.  
  852. MACRO {jul} {"July"}
  853.  
  854. MACRO {aug} {"August"}
  855.  
  856. MACRO {sep} {"September"}
  857.  
  858. MACRO {oct} {"October"}
  859.  
  860. MACRO {nov} {"November"}
  861.  
  862. MACRO {dec} {"December"}
  863.  
  864. MACRO {acmcs} {"ACM Computing Surveys"}
  865.  
  866. MACRO {acta} {"Acta Informatica"}
  867.  
  868. MACRO {cacm} {"Communications of the ACM"}
  869.  
  870. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  871.  
  872. MACRO {ibmsj} {"IBM Systems Journal"}
  873.  
  874. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  875.  
  876. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  877.  
  878. MACRO {ieeetcad}
  879.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  880.  
  881. MACRO {ipl} {"Information Processing Letters"}
  882.  
  883. MACRO {jacm} {"Journal of the ACM"}
  884.  
  885. MACRO {jcss} {"Journal of Computer and System Sciences"}
  886.  
  887. MACRO {scp} {"Science of Computer Programming"}
  888.  
  889. MACRO {sicomp} {"SIAM Journal on Computing"}
  890.  
  891. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  892.  
  893. MACRO {tods} {"ACM Transactions on Database Systems"}
  894.  
  895. MACRO {tog} {"ACM Transactions on Graphics"}
  896.  
  897. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  898.  
  899. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  900.  
  901. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  902.  
  903. MACRO {tcs} {"Theoretical Computer Science"}
  904.  
  905. READ
  906.  
  907. STRINGS { longest.label }
  908.  
  909. INTEGERS { number.label longest.label.width }
  910.  
  911. FUNCTION {initialize.longest.label}
  912. { "" 'longest.label :=
  913.   #1 'number.label :=
  914.   #0 'longest.label.width :=
  915. }
  916.  
  917. FUNCTION {longest.label.pass}
  918. { number.label int.to.str$ 'label :=
  919.   number.label #1 + 'number.label :=
  920.   label width$ longest.label.width >
  921.     { label 'longest.label :=
  922.       label width$ 'longest.label.width :=
  923.     }
  924.     'skip$
  925.   if$
  926. }
  927.  
  928. EXECUTE {initialize.longest.label}
  929.  
  930. ITERATE {longest.label.pass}
  931.  
  932. FUNCTION {begin.bib}
  933. { preamble$ empty$
  934.     'skip$
  935.     { preamble$ write$ newline$ }
  936.   if$
  937.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  938. }
  939.  
  940. EXECUTE {begin.bib}
  941.  
  942. EXECUTE {init.state.consts}
  943.  
  944. ITERATE {call.type$}
  945.  
  946. FUNCTION {end.bib}
  947. { newline$
  948.   "\end{thebibliography}" write$ newline$
  949. }
  950.  
  951. EXECUTE {end.bib}
  952.